import request from './service';

// Login Api
export function loginApi(data: any) {
  return request({
    url: '/asset/login',
    method: 'POST',
    data,
  });
}
export function adminListApi(data: any) {
  return request({
    url: '/asset/system/admin/v1/list',
    method: 'POST',
    data,
  });
}
export function adminAddApi(data: any) {
  return request({
    url: '/asset/system/admin/v1/add',
    method: 'POST',
    data,
  });
}
export function resetPasswordApi(data: any) {
  return request({
    url: '/asset/system/admin/v1/reset-password',
    method: 'POST',
    data,
  });
}
export function adminDelApi(data: any) {
  return request({
    url: '/asset/system/admin/v1/remove',
    method: 'get',
    data,
  });
}
// 设备类型
export function assetTypeAddApi(data: any) {
  return request({
    url: '/asset/asset-type/v1/add',
    method: 'POST',
    data,
  });
}
export function assetTypeUpdateApi(data: any) {
  return request({
    url: '/asset/asset-type/v1/update',
    method: 'POST',
    data,
  });
}
export function assetTypeListApi(data: any) {
  return request({
    url: '/asset/asset-type/v1/list',
    method: 'POST',
    data,
  });
}
export function assetTypeDelApi(data: any) {
  return request({
    url: '/asset/asset-type/v1/remove',
    method: 'get',
    data,
  });
}
// 生产厂家
export function manufacturerListApi(data: any) {
  return request({
    url: '/asset/manufacturer/v1/list',
    method: 'post',
    data,
  });
}
export function manufacturerAddApi(data: any) {
  return request({
    url: '/asset/manufacturer/v1/add',
    method: 'post',
    data,
  });
}
export function manufacturerUpdateApi(data: any) {
  return request({
    url: '/asset/manufacturer/v1/update',
    method: 'post',
    data,
  });
}
export function manufacturerDelApi(data: any) {
  return request({
    url: '/asset/manufacturer/v1/remove',
    method: 'get',
    data,
  });
}

// 配电间
export function roomListApi(data: any) {
  return request({
    url: '/asset/room/v1/list',
    method: 'POST',
    data,
  });
}
export function roomAddApi(data: any) {
  return request({
    url: '/asset/room/v1/add',
    method: 'POST',
    data,
  });
}
export function roomUpdateApi(data: any) {
  return request({
    url: '/asset/room/v1/update',
    method: 'POST',
    data,
  });
}
export function roomDelApi(data: any) {
  return request({
    url: '/asset/room/v1/remove',
    method: 'get',
    data,
  });
}

// 网关
export function gatewayListApi(data: any) {
  return request({
    url: '/asset/gateway/v1/list',
    method: 'POST',
    data,
  });
}
export function gatewayAddApi(data: any) {
  return request({
    url: '/asset/gateway/v1/add',
    method: 'POST',
    data,
  });
}

export function gatewayUpdateApi(data: any) {
  return request({
    url: '/asset/gateway/v1/update',
    method: 'POST',
    data,
  });
}
export function gatewayDelApi(data: any) {
  return request({
    url: '/asset/gateway/v1/remove',
    method: 'get',
    data,
  });
}

// 阈值
export function thresholdAddApi(data: any) {
  return request({
    url: '/asset/threshold/v1/add',
    method: 'POST',
    data,
  });
}
export function thresholdDetailApi(data: any) {
  return request({
    url: '/asset/threshold/v1/detail',
    method: 'POST',
    data,
  });
}

// 消息
export function messageListApi(data: any) {
  return request({
    url: '/asset/message/v1/list',
    method: 'POST',
    data,
  });
}
export function messageStatusUpdateApi(data: any) {
  return request({
    url: '/asset/message/v1/status/update/1',
    method: 'POST',
    data,
  });
}
export function messageDelApi(data: any) {
  return request({
    url: '/asset/message/v1/remove/1',
    method: 'get',
    data,
  });
}

// 资产管理 - 设备列表
export function equipmentListApi(data: any) {
  return request({
    url: '/asset/equipment/v1/list',
    method: 'POST',
    data,
  });
}
export function equipmentAddApi(data: any) {
  return request({
    url: '/asset/equipment/v1/add',
    method: 'POST',
    data,
  });
}
export function equipmentUpdateApi(data: any) {
  return request({
    url: '/asset/equipment/v1/update',
    method: 'POST',
    data,
  });
}
// 资产管理 - 设备详情
export function equipmentDetailApi(data: any) {
  return request({
    url: '/asset/equipment/v1/detail',
    method: 'get',
    data,
  });
}
// 资产管理 - 设备删除
export function equipmentDelApi(data: any) {
  return request({
    url: '/asset/equipment/v1/remove',
    method: 'get',
    data,
  });
}
// 资产管理 - 设备模板下载
export function equipmentTemplateDownloadApi(data: any) {
  return request({
    url: '/asset/equipment/v1/download-template',
    method: 'get',
    data,
  });
}
// 资产管理 - 设备模板上传
export function equipmentTemplateUploadApi(data: any) {
  return request({
    url: '/asset/equipment/v1/upload',
    method: 'POST',
    data,
  });
}

// 资产管理 - 二维码列表
export function qrcodeListApi(data: any) {
  return request({
    url: '/asset/qrcode/v1/list',
    method: 'POST',
    data,
  });
}
// 资产管理 - 二维码生成
export function qrcodeGenerateApi(data: any) {
  return request({
    url: '/asset/qrcode/v1/generate',
    method: 'POST',
    data,
  });
}
// 二维码下载接口：明确声明接收二进制，并声明图片的 Accept
export function qrcodeDownloadApi(data: any) {
  return request({
    url: '/asset/qrcode/v1/download',
    method: 'get',
    data,
    responseType: 'blob',
    headers: { 'Content-Type': 'application/json;application/octet-stream' },
  });
}
// 资产管理 - 二维码上传
export function qrcodeUploadApi(data: any) {
  return request({
    url: '/asset/qrcode/v1/upload',
    method: 'POST',
    data,
  });
}
// 资产管理 - 二维码删除
export function qrcodeDelApi(data: any) {
  return request({
    url: '/asset/qrcode/v1/remove',
    method: 'get',
    data,
  });
}

// 资产管理 - 部门列表
export function deptTreeApi(data: any) {
  return request({
    url: '/asset/dept/v1/tree',
    method: 'get',
    data,
  });
}
// 资产管理 - 部门新增
export function deptAddApi(data: any) {
  return request({
    url: '/asset/dept/v1/add',
    method: 'POST',
    data,
  });
}
// 资产管理 - 部门更新
export function deptUpdateApi(data: any) {
  return request({
    url: '/asset/dept/v1/update',
    method: 'POST',
    data,
  });
}
// 资产管理 - 部门删除
export function deptDelApi(data: any) {
  return request({
    url: '/asset/dept/v1/remove',
    method: 'DELETE',
    data,
  });
}
// 资产管理 - 用户列表
export function userListApi(data: any) {
  return request({
    url: '/asset/user/v1/list',
    method: 'POST',
    data,
  });
}
// 资产管理 - 用户新增
export function userAddApi(data: any) {
  return request({
    url: '/asset/user/v1/add',
    method: 'POST',
    data,
  });
}
// 资产管理 - 用户更新
export function userUpdateApi(data: any) {
  return request({
    url: '/asset/user/v1/update',
    method: 'POST',
    data,
  });
}
// 资产管理 - 用户详情
export function userDetailApi(data: any) {
  return request({
    url: '/asset/user/v1/detail',
    method: 'get',
    data,
  });
}
// 资产管理 - 用户删除
export function userDelApi(data: any) {
  return request({
    url: '/asset/user/v1/remove',
    method: 'get',
    data,
  });
}
// 资产管理 - 用户模板下载
export function userTemplateDownloadApi(data: any) {
  return request({
    url: '/asset/user/v1/download-template',
    method: 'get',
    data,
  });
}
// 资产管理 - 用户模板上传
export function userTemplateUploadApi(data: any) {
  return request({
    url: '/asset/user/v1/upload',
    method: 'POST',
    data,
  });
}

//厂房管理
export function addWorkshopApi(data: any) {
  return request({
    url: '/asset/workshop/v1/add',
    method: 'POST',
    data,
  });
}
// 厂房管理 - 厂房列表
export function workshopListApi(data: any) {
  return request({
    url: '/asset/workshop/v1/list',
    method: 'POST',
    data,
  });
}
// 厂房管理 - 厂房更新
export function workshopUpdateApi(data: any) {
  return request({
    url: '/asset/workshop/v1/update',
    method: 'POST',
    data,
  });
}
// 厂房管理 - 厂房详情
export function workshopDetailApi(data: any) {
  return request({
    url: '/asset/workshop/v1/detail',
    method: 'get',
    data,
  });
}

//localhost:8088/asset/workshop/v1/remove/1
// 厂房管理 - 厂房删除
export function workshopDelApi(data: any) {
  return request({
    url: '/asset/workshop/v1/remove',
    method: 'get',
    data,
  });
}
// 厂房管理 - 厂房下拉
export function workshopSelectApi(data: any) {
  return request({
    url: '/asset/workshop/v1/select',
    method: 'get',
    data,
  });
}
